<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['lang']){
	$_SESSION['show_lang']=$_RQ['lang'];
}
if($_RQ['op']=='main'){
	$return['list']=array();
	$return['status']=isset($_RQ['status'])?$_RQ['status']:0;
	exi($return);
}
// js 获取数据
if($_RQ['op']=='getlist'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'merchid'=>$merchid);
	$params['status']=intval($_RQ['status']);
	if(!empty($_RQ['ordersn'])){
		$params['ordersn']=intval($_RQ['ordersn']);
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$total='';
	$list=pdo_getslice('jy_douyintui_dian_order',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	foreach($list as &$item){
		$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
		$item['statustitle']=$this->order_status[$item['status']];
	}
	$return['list']=$list;
	exi($return);
}
if($_RQ['op']=='pay'){
	$id = intval($_RQ['id']);
	if(!$id){
		exi('订单不存在，请重新选择订单','error');
	}
	$pay_id=pdo_getcolumn('jy_douyintui_dian_order',array('uniacid'=>$_SESSION['uniacid'],'id'=>$id),'pay_id');
	exi($pay_id);
}
?>